package com.currency.mall.netWork;

import com.currency.mall.netWork.api.HomeApi;
import com.currency.mall.netWork.api.LoginApi;
import com.currency.mall.netWork.api.OderApi;
import com.currency.mall.netWork.api.SharesApi;
import com.currency.mall.netWork.api.UserApi;

import retrofit2.Retrofit;

import static com.mifengs.commonbase.net.NetRetorfit.getCommonRetrofit;

/**
 * Created by Administrator on 2017/10/24.
 */

public class NetWork {

    private static LoginApi mLoginApi;
    private static UserApi mUserApi;
    private static SharesApi mSharesApi;
    private static OderApi mOderApi;
    private static HomeApi mHomeApi;


    public static LoginApi getLoginApi() {
        if (mLoginApi == null) {
            Retrofit retrofit = getCommonRetrofit();
            mLoginApi = retrofit.create(LoginApi.class);
        }
        return mLoginApi;
    }

    public static UserApi getUserApi() {
        if (mUserApi == null) {
            Retrofit retrofit = getCommonRetrofit();
            mUserApi = retrofit.create(UserApi.class);
        }
        return mUserApi;
    }

    public static SharesApi getSharesApi() {
        if (mSharesApi == null) {
            Retrofit retrofit = getCommonRetrofit();
            mSharesApi = retrofit.create(SharesApi.class);
        }
        return mSharesApi;
    }

    public static OderApi getOderApi() {
        if (mOderApi == null) {
            Retrofit retrofit = getCommonRetrofit();
            mOderApi = retrofit.create(OderApi.class);
        }
        return mOderApi;
    }

    public static HomeApi getHomeApi() {
        if (mHomeApi == null) {
            Retrofit retrofit = getCommonRetrofit();
            mHomeApi = retrofit.create(HomeApi.class);
        }
        return mHomeApi;
    }



}
